.session-viewer-page {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 24px;

  &.inside-iframe {
    position: relative;
    overflow: hidden;
  }

  .session-recording-player-row {
    display: flex;
    width: 100%;
    gap: 12px;
    margin: 12px 0;

    .session-recording-player-container {
      flex: 1;
      display: flex;
      flex-direction: row;
      justify-content: center;
      overflow-x: auto;

      iframe {
        background: white;
      }
      .rr-player .rr-player__frame {
        width: auto;
        .overlay-frame {
          display: flex;
          height: 100%;
          width: 100%;
          justify-content: center;
          align-items: center;
          position: absolute;
          color: rgba(255, 255, 255, 0.8);
          font-size: 4rem;
          .blur {
            height: 100%;
            width: 100%;
            position: absolute;
            backdrop-filter: blur(4px);
            z-index: 1;
            background-color: rgba(0, 0, 0, 0.4);
          }
          .overlay-content {
            z-index: 10;
          }
        }
      }
      #rq-controller-btns {
        display: flex;
        .rq-controller-button {
          cursor: pointer;
          padding-right: 4px;
          display: flex;
          svg {
            height: 24px;
            width: 24px;
          }
        }
      }
      #rq-controller-btns {
        display: flex;
        .rq-controller-button {
          cursor: pointer;
          padding-right: 4px;
          display: flex;
          svg {
            height: 24px;
            width: 24px;
          }
        }
      }
    }

    .session-recording-properties {
      width: 400px;
      overflow: auto;
      min-height: 100%;

      > div {
        height: auto;
      }
      .ant-input,
      .ant-input-number-input {
        box-shadow: var(--input-box-shadow);
        background: var(--requestly-color-surface-0);
      }

      .session-property-label {
        margin-bottom: 4px;
      }
      &.ant-pro-card.primary-card {
        background: none !important;
        border: none;

        .ant-pro-card-body {
          padding: 0;
        }
      }
      .ant-pro-card-body .session-start-time-input-wrapper {
        display: flex;
        align-items: center;
        column-gap: 10px;

        .ant-input-number-group-wrapper {
          width: 100%;

          .ant-input-number-wrapper .ant-input-number-group-addon {
            background: var(--requestly-color-surface-0);
          }
        }
      }
      .readonly-session-description {
        border: 1px solid var(--border);
        box-shadow: var(--input-box-shadow);
        border-radius: var(--border-radius-sm);
        background: var(--requestly-color-surface-1);
        padding: 1rem;
        white-space: pre-wrap;
      }
    }
  }

  .session-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .back-button {
      margin-right: 8px;
      padding: 8px;
      border: none;
    }

    .session-title-name {
      .session-title-name-wrapper {
        width: 100%;
        .ant-input {
          font-size: 1.25rem;
          max-width: 600px;
          padding: 0;
          border-radius: 0;
          transition: 0.05s ease-in-out;
          max-width: 450px;
        }
      }
      .ant-input {
        &:focus {
          border-bottom: 1px solid var(--requestly-color-primary);
        }
        color: var(--requestly-color-text-default);
        font-size: 1.25rem;
        font-weight: 500;
      }
      .session-title {
        display: flex;
        gap: 4px;
        width: 460px;
        color: var(--requestly-color-text-default);
        font-size: 1.25rem;
        font-weight: 500;

        svg {
          align-self: center;
          cursor: pointer;
          width: 16px;
          height: 16px;
          min-width: 16px;
          color: var(--text-gray);
        }

        &.inside-iframe {
          width: 100%;

          svg {
            color: inherit;
          }
        }
      }
    }

    .editor-title-container {
      .session-title-name {
        min-height: 33px;
      }
    }

    .session-recording-name {
      line-height: 40px;
      margin: 0;
    }

    .session-viewer-actions {
      flex: 0 0 auto;
      display: flex;
      flex-direction: row;
      column-gap: 10px;
      position: relative;

      button {
        height: 32px;
      }

      .session-viewer-save-action-btn.ant-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .download-recording-btn.ant-btn svg,
      .session-viewer-save-action-btn.ant-btn svg {
        width: 10px;
        height: 10px;
        margin-top: 1px;
        margin-left: 5px;
      }
    }
  }

  .session-info-divider {
    border-width: 2px;
    height: 18px;
  }

  .session-panels-container {
    > div {
      padding-top: 0;
    }

    &.inside-iframe,
    &.expand-panels-container {
      max-width: 94vw;
      position: absolute;
      bottom: 0;
      left: 50%;
      z-index: 10;
      transform: translate(-50%, calc(100% - 50px));
    }

    &.expand-panels-container {
      bottom: 20px;
      transform: translate(-50%, 0);
    }
    & .ant-tabs-top > .ant-tabs-nav {
      margin-bottom: 6px;
    }
    /* Hiding inkbar due to Ant bug where its position is not recalculated on badge updates */
    .ant-tabs-ink-bar {
      display: none;
    }

    .ant-tabs-tab {
      border-bottom: 2px solid transparent;

      &.ant-tabs-tab-active {
        border-bottom-color: #1e69ff;
      }

      .ant-tabs-tab-btn > span {
        display: flex;
        align-items: center;
      }
    }

    .session-panel-content {
      height: 300px;
      overflow: auto;
      font-size: var(--requestly-font-size-sm, 12px);

      .placeholder {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      span.ant-typography.recording-options-message {
        font-size: var(--requestly-font-size-md, 14px);
      }

      .empty-table-view {
        background: var(--requestly-color-surface-0);
        height: 100%;
        border: 1px solid var(--border-dark);
        border-radius: var(--border-radius-sm);
      }
    }
  }

  .console-log-row {
    .primary-message,
    .secondary-message {
      white-space: pre-wrap;
      font-family: var(--requestly-font-family-code, monospace), span {
        font-family: var(--requestly-font-family-code, monospace);
      }
    }

    .info span {
      color: #157af3;
    }
    .error span {
      color: #ff4d4f;
    }
    .warn span {
      color: #d3a403;
    }
  }

  .session-properties-wrapper {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;

    & .ant-input-group-wrapper {
      width: auto;

      .ant-input-affix-wrapper {
        background: var(--requestly-color-surface-1);
      }
    }
    & .ant-input-group-addon {
      background: var(--requestly-color-surface-1);
      color: var(--text-gray);
    }

    .session-page-url-property .ant-input-wrapper .ant-input {
      width: 250px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      background: var(--requestly-color-surface-1);
    }

    .session-duration-property .ant-input-wrapper .ant-input {
      width: 75px;
      background: var(--requestly-color-surface-1);
    }

    .session-recorded-at-property .ant-input-wrapper .ant-input {
      width: 155px;
      background: var(--requestly-color-surface-1);
    }
  }

  .session-onboarding-prompt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--requestly-color-primary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    padding: 12px 16px;

    .display-flex {
      gap: 8px;
    }

    &-check-icon {
      align-self: center;

      svg {
        width: 32px;
        height: 32px;
      }
    }
    &-message {
      color: var(--requestly-color-text-default);

      > p {
        margin-bottom: 0;
      }
    }
    &-actions {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    &-close-icon {
      color: var(--text-gray);
      transition: 0.2s ease-in-out;

      svg {
        width: 16px;
        height: 16px;
      }
      &:hover {
        color: var(--requestly-color-text-default);
      }
    }
    &-settings-link {
      display: flex;
      align-items: center;
      gap: 4px;
      color: var(--requestly-color-text-default);
      font-weight: 500;

      & span:not(.anticon) {
        text-decoration: underline;
      }
    }
  }

  .save-recording-config-popup {
    position: absolute;
    width: 413px;
    top: 42px;
    right: 0px;
    z-index: 10;
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius-md);
    background-color: var(--requestly-color-surface-1);

    // ant-design modal's default box shadow
    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 9px 28px 8px rgba(0, 0, 0, 0.2);

    .header-container {
      padding: 8px 8px 8px 20px;
      border-top-left-radius: inherit;
      border-top-right-radius: inherit;
      background-color: var(--requestly-color-surface-0);

      .header {
        font-size: var(--requestly-font-size-md, 14px);
        font-weight: 700;
      }

      button.ant-btn {
        border: none;
        padding: 16px 11px;

        svg {
          font-size: 15px;
        }
      }
    }

    .config-container {
      padding: 16px 20px;

      > div {
        margin-bottom: 24px;
      }

      .mode-radio-group {
        display: flex;
        flex-direction: column;
        row-gap: 8px;
      }

      .config-label {
        font-size: var(--requestly-font-size-md, 14px);
        line-height: 25px;
        margin-bottom: 12px;
        color: var(--text-gray);
      }
    }

    .footer {
      padding: 4px 8px;
      border-bottom-left-radius: inherit;
      border-bottom-right-radius: inherit;
      border-top: 1px solid var(--border-dark);
      background-color: var(--requestly-color-surface-0);
    }
  }
}

.session-viewer-more-actions {
  .more-action {
    padding: 5px 10px;

    .more-action-icon {
      width: initial;
      padding: 5px !important;
    }
  }
}

.save-session-btns-container {
  display: flex;
  align-items: center;

  .session-viewer-save-action-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 1px solid #ffffff55;
  }

  .save-popup-button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

body.dark {
  .session-viewer-page {
    .session-recording-name {
      color: rgba(255, 255, 255, 0.85) !important;
    }

    .rr-controller {
      color: white !important;

      .rr-timeline {
        width: 100% !important;
      }
      .rr-timeline__time {
        color: white !important;
      }

      svg {
        fill: white !important;
      }

      .rr-controller__btns {
        gap: 8px;
      }
    }

    .ant-pro-card,
    .rr-player {
      background: var(--requestly-color-surface-1) !important;
      border: 1px solid var(--border-dark);
      border-radius: var(--border-radius-sm);
      box-sizing: content-box;
    }

    .rr-player {
      overflow: hidden;
      padding-top: 10px;
    }

    .rr-controller {
      background: transparent;
    }

    .ant-input-number-group-addon {
      color: var(--requestly-color-text-default);
      border-color: #313a46;
      background-color: #313a46;
    }

    .ant-btn-link {
      padding: 5px;
      min-height: 0;

      &:hover,
      &:focus {
        border-color: transparent !important;
        background: transparent;
      }
    }
  }
}

.session-metadata-tooltip-icon {
  margin: 4.8px 0 0 4px;
  svg {
    display: block;
    height: 13px;
    width: 13px;
    cursor: pointer;
  }
}

@media screen and (max-width: 768px) {
  .session-viewer-page {
    .session-viewer-header {
      flex-direction: column;
      align-items: flex-start;
      row-gap: 10px;
    }

    .session-recording-player-row {
      flex-direction: column;

      .session-recording-player-container {
        width: 100%;
      }

      .session-recording-properties {
        width: 100%;
        min-height: auto;
      }
    }
    .right-info {
      display: none;
    }
  }
}

@media (max-width: 680px) {
  .session-viewer-page {
    .session-properties-wrapper {
      .ant-input-group-wrapper.session-page-url-property {
        .ant-input {
          width: 100% !important;
        }
      }
      .ant-input-group-wrapper {
        width: 100%;
      }
    }
  }
}

@media (max-width: 550px) {
  .app-header,
  .app-sidebar {
    display: none;
  }

  .session-viewer-page {
    padding-inline: 10px;
    overflow-x: hidden;

    .rr-controller {
      .rr-controller__btns {
        gap: 0px !important;
      }
    }
  }
}

@media screen and (max-width: 520px) {
  .session-viewer-page .session-properties-wrapper .session-page-url-property .ant-input-wrapper .ant-input {
    width: 100px;
  }
}

@media screen and (min-width: 520px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 28rem;
        }
      }
    }
  }
}

@media screen and (min-width: 768px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 20rem;
          word-break: break-all;
        }

        .right-info {
          display: block;
        }
      }
    }
  }
}

@media screen and (min-width: 850px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 26rem;
        }
      }
    }
  }
}

@media screen and (min-width: 992px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 34rem;
        }
      }
    }
  }
}

@media screen and (min-width: 1200px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 48rem;
        }
      }
    }
  }
}

@media screen and (min-width: 1400px) {
  .session-viewer-page {
    .session-details-panel-row {
      &.console-log-row {
        .primary-message,
        .secondary-message {
          width: 64rem;
        }
      }
    }
  }
}
